/**
 * 重置、返回图标
 * @param ratio 画布大小比例
 * @param color 颜色
 * @returns 数据地址
 */
const ResetStageImage = (radio?:number,color?:string):string=> {
    const r=radio||2;
    const col=color||'#ffffff';
    const canvas=document.createElement('canvas');
    canvas.width=canvas.height=32*r;
    const ctx=canvas.getContext('2d')!;
    ctx.save();
    ctx.strokeStyle="rgba(0,0,0,0)";
    ctx.miterLimit=4;
    ctx.font="15px ''";
    ctx.fillStyle=col;
    ctx.font="   15px ''";
    ctx.scale(0.021,0.021);
    ctx.translate(500,500);
    ctx.save();
    ctx.font="   15px ''";
    ctx.beginPath();
    ctx.moveTo(976*r,384*r);
    ctx.lineTo(784*r,384*r);
    ctx.bezierCurveTo(757.6*r,384*r,736*r,362.4*r,736*r,336*r);
    ctx.bezierCurveTo(736*r,309.6*r,757.6*r,288*r,784*r,288*r);
    ctx.lineTo(862.4*r,288*r);
    ctx.bezierCurveTo(788.8*r,172.8*r,659.2*r,96*r,512*r,96*r);
    ctx.bezierCurveTo(282.4*r,96*r,96*r,282.4*r,96*r,512*r);
    ctx.bezierCurveTo(96*r,741.6*r,282.4*r,928*r,512*r,928*r);
    ctx.bezierCurveTo(736*r,928*r,919.2*r,750.4*r,927.2*r,528*r);
    ctx.lineTo(928*r,528*r);
    ctx.bezierCurveTo(928*r,501.6*r,949.6*r,480*r,976*r,480*r);
    ctx.bezierCurveTo(1002.4*r,480*r,1024*r,501.6*r,1024*r,528*r);
    ctx.bezierCurveTo(1024*r,531.2*r,1024*r,534.4*r,1023.2*r,536.8*r);
    ctx.bezierCurveTo(1010.4*r,808*r,786.4*r,1024*r,512*r,1024*r);
    ctx.bezierCurveTo(229.6*r,1024*r,0,794.4*r,0,512*r);
    ctx.bezierCurveTo(0*r,229.6*r,229.6*r,0,512*r,0);
    ctx.bezierCurveTo(683.2*r,0,835.2*r,84,928*r,213.6*r);
    ctx.lineTo(928*r,144*r);
    ctx.bezierCurveTo(928*r,117.6*r,949.6*r,96*r,976*r,96*r);
    ctx.bezierCurveTo(1002.4*r,96*r,1024*r,117.6*r,1024*r,144*r);
    ctx.lineTo(1024*r,336*r);
    ctx.bezierCurveTo(1024*r,362.4*r,1002.4*r,384*r,976*r,384*r);
    ctx.closePath();
    ctx.fill();
    ctx.stroke();
    ctx.restore();
    ctx.restore();
    return canvas.toDataURL('image/png');
};


export {ResetStageImage};